package com.tuju.jetpackfirstdemo.data.room

import android.content.Context
import com.tuju.jetpackfirstdemo.ui.room_demo.RoomViewModelFactory

object Injection {

    fun provideUserDataSource(context: Context): UserDao {
        val database = UsersDatabase.getInstance(context)
        return database.userDao()
    }

    fun provideViewModelFactory(context: Context): RoomViewModelFactory {
        val dataSource = provideUserDataSource(context)
        return RoomViewModelFactory(dataSource)
    }

}